export interface ElementIdentifierItemConfig {
  id: string
  name: string
}

export interface ElementIdentifierResult extends ElementIdentifierItemConfig {
  category: string
  subCategory: string
  eName: string
}

export interface ElementIdentifierItem {
  [subCategory: string]: ElementIdentifierItemConfig
}

export interface ElementIdentifierConfig {
  [category: string]: ElementIdentifierItem
}

type ExtractElementIdentifierIds<T> = T extends { id: infer U } ? U : {
  [K in keyof T]: ExtractElementIdentifierIds<T[K]>
}[keyof T]

export type ElementIdentifierId = ExtractElementIdentifierIds<typeof ELEMENT_IDENTIFIER_CONFIG>

/**
 * 元素分类
 */
export const ELEMENT_IDENTIFIER_CONFIG = {
  default: {
    announcement: { id: 'default.announcement', name: '公告栏' },
    banner: { id: 'default.banner', name: '公告横幅' },
    header: { id: 'default.header', name: '顶部菜单' },
    headerOne: { id: 'default.headerOne', name: '顶部菜单1' },
    headerTwo: { id: 'default.headerTwo', name: '顶部菜单2' },
    headerThree: { id: 'default.headerThree', name: '顶部菜单3' },
    headerFour: { id: 'default.headerFour', name: '顶部菜单4' },
    headerFive: { id: 'default.headerFive', name: '顶部菜单5' },
    headerSix: { id: 'default.headerSix', name: '顶部菜单6' },
    headerNav: { id: 'default.headerNav', name: '顶部导航' },
    decoration: { id: 'default.decoration', name: '装饰' },
    userCenter: { id: 'default.userCenter', name: '用户中心' },
    profile: { id: 'default.profile', name: '个人信息' },
    input: { id: 'default.input', name: '输入框' },
    searchBox: { id: 'default.searchBox', name: '搜索框' },
    discovery: { id: 'default.discovery', name: '发现' },
    hotNews: { id: 'default.hotNews', name: '热点' },
    hotList: { id: 'default.hotList', name: '热搜' },
    recentActivities: { id: 'default.recentActivities', name: '近期动态' },
    moreResults: { id: 'default.moreResults', name: '更多结果' },
    moreRecommend: { id: 'default.moreRecommend', name: '更多推荐' },
    moreVideo: { id: 'default.moreVideo', name: '更多视频' },
    moreButton: { id: 'default.moreButton', name: '更多按钮' },
    contentAction: { id: 'default.contentAction', name: '内容操作' },
    contentActionTwo: { id: 'default.contentActionTwo', name: '内容操作2' },
    bottomInfo: { id: 'default.bottomInfo', name: '底部信息' },
    bottomSearchBox: { id: 'default.bottomSearchBox', name: '底部搜索框' },
    pageSeparator: { id: 'default.pageSeparator', name: '页面分割线' },
    footerNavigation: { id: 'default.footerNavigation', name: '页脚导航' },
    footer: { id: 'default.footer', name: '页脚' },
    loginModal: { id: 'default.loginModal', name: '登录弹窗' },
    loginModalTwo: { id: 'default.loginModalTwo', name: '登录弹窗2' },
    rightAside: { id: 'default.rightAside', name: '右侧边栏' },
    rightAsideToolbar: { id: 'default.rightAsideToolbar', name: '右侧工具栏' },
    leftAside: { id: 'default.leftAside', name: '左侧边栏' },
    leftAsideToolbar: { id: 'default.leftAsideToolbar', name: '左侧工具栏' },
    carousel: { id: 'default.carousel', name: '轮播图' },
    friendLink: { id: 'default.friendLink', name: '友情链接' },
    copyright: { id: 'default.copyright', name: '版权信息' },
    rank: { id: 'default.rank', name: '排行榜' },
    tag: { id: 'default.tag', name: '标签' },
    share: { id: 'default.share', name: '分享' },
    featuredContent: { id: 'default.featuredContent', name: '精选内容' },
    platformGuide: { id: 'default.platformGuide', name: '平台指南' },
    latestMessage: { id: 'default.latestMessage', name: '最新消息' },
    newArrivals: { id: 'default.newArrivals', name: '产品上新' },
    oneClickGeneration: { id: 'default.oneClickGeneration', name: '一键生成' },
    feedback: { id: 'default.feedback', name: '内容反馈' },
    feedbackType: { id: 'default.feedbackType', name: '反馈类型' },
    hoverToolBar: { id: 'default.hoverToolBar', name: '悬浮工具栏' },
    selectedSearch: { id: 'default.selectedSearch', name: '选中搜索' },
    classificationList: { id: 'default.classificationList', name: '分类列表' },
    alsoDo: { id: 'default.alsoDo', name: '还可以' },
    alsoAsk: { id: 'default.alsoAsk', name: '还在问' },
    todayInHistory: { id: 'default.todayInHistory', name: '历史上的今天' },
    newbieTutorial: { id: 'default.newbieTutorial', name: '新手教程' },
    scrollFill: { id: 'default.scrollFill', name: '滚动条填充' },
    hrefTranslate: { id: 'default.hrefTranslate', name: '网页转换' },
    regionSwitch: { id: 'default.regionSwitch', name: '区域切换' },
    minMenu: { id: 'default.minMenu', name: '迷你菜单' },
    hoverBall: { id: 'default.hoverBall', name: '悬浮助手' },
    privacyPreference: { id: 'default.privacyPreference', name: '隐私偏好' },
    privacyPreferenceHover: { id: 'default.privacyPreferenceHover', name: '隐私偏好（悬浮）' },
    backTop: { id: 'default.backTop', name: '返回顶部' },
    assistantMode: { id: 'default.assistantMode', name: '辅助模式' },
    accessibility: { id: 'default.accessibility', name: '无障碍' },
  },
  base: {
    metadata: { id: 'base.metadata', name: '元数据' },
    language: { id: 'base.language', name: '语言' },
    personalization: { id: 'base.personalization', name: '个性化' },
    name: { id: 'base.name', name: '名称' },
    description: { id: 'base.description', name: '描述' },
    summary: { id: 'base.summary', name: '摘要' },
    weather: { id: 'base.weather', name: '天气' },
    work: { id: 'base.work', name: '作品' },
    product: { id: 'base.product', name: '产品' },
    game: { id: 'base.game', name: '游戏' },
    gameWork: { id: 'base.gameWork', name: '游戏作品' },
    software: { id: 'base.software', name: '软件' },
    position: { id: 'base.position', name: '位置' },
    icon: { id: 'base.icon', name: '图标' },
    iconTwo: { id: 'base.iconTwo', name: '图标2' },
    iconThree: { id: 'base.iconThree', name: '图标3' },
    iconFour: { id: 'base.iconFour', name: '图标4' },
    subject: { id: 'base.subject', name: '主题' },
    title: { id: 'base.title', name: '标题' },
    publish: { id: 'base.publish', name: '发布' },
    quote: { id: 'base.quote', name: '引用' },
    edit: { id: 'base.edit', name: '编辑' },
    report: { id: 'base.report', name: '举报' },
    follow: { id: 'base.follow', name: '关注' },
    favorite: { id: 'base.favorite', name: '收藏' },
    publishTime: { id: 'base.publishTime', name: '发布时间' },
    editTime: { id: 'base.editTime', name: '编辑时间' },
  },
  menu: {
    request: { id: 'menu.request', name: '请求' },
    wiki: { id: 'menu.wiki', name: 'Wiki' },
    statistics: { id: 'menu.statistics', name: '统计' },
    services: { id: 'menu.services', name: '服务' },
    workflow: { id: 'menu.workflow', name: '流水线' },
    management: { id: 'menu.management', name: '管理' },
  },
  component: {
    filterComponent: { id: 'component.filterComponent', name: '筛选组件' },
    tagFilterComponent: { id: 'component.tagFilterComponent', name: '标签筛选' },
    orderComponent: { id: 'component.orderComponent', name: '排序组件' },
    link: { id: 'component.link', name: '链接' },
    videoLink: { id: 'component.videoLink', name: '视频链接' },
    bookLink: { id: 'component.bookLink', name: '书籍链接' },
    newsLink: { id: 'component.newsLink', name: '资讯链接' },
  },
  service: {
    searchService: { id: 'service.searchService', name: '搜索服务' },
    navigationService: { id: 'service.navigationService', name: '导航服务' },
    communityService: { id: 'service.communityService', name: '社区服务' },
    gameEntertainment: { id: 'service.gameEntertainment', name: '游戏娱乐' },
    mobileService: { id: 'service.mobileService', name: '移动服务' },
    developerService: { id: 'service.developerService', name: '站长与开发者服务' },
    mobileSoftware: { id: 'service.mobileSoftware', name: '手机软件' },
    softwareTools: { id: 'service.softwareTools', name: '软件工具' },
    desktopTools: { id: 'service.desktopTools', name: '桌面工具' },
    documentTools: { id: 'service.documentTools', name: '文档工具' },
    searchProducts: { id: 'service.searchProducts', name: '搜索产品' },
  },
  pagination: {
    nextPage: { id: 'pagination.nextPage', name: '下一页' },
    prevPage: { id: 'pagination.prevPage', name: '上一页' },
  },
  ad: {
    contentAd: { id: 'ad.contentAd', name: '内容广告' },
    resultAd: { id: 'ad.resultAd', name: '结果广告' },
    remunerationAd: { id: 'ad.remunerationAd', name: '滚动广告' },
    dynamicAd: { id: 'ad.dynamicAd', name: '动态广告' },
    brandAd: { id: 'ad.brandAd', name: '品牌广告' },
    bannerAd: { id: 'ad.bannerAd', name: '横幅广告' },
    imageAd: { id: 'ad.imageAd', name: '图片广告' },
    videoAd: { id: 'ad.videoAd', name: '视频广告' },
    adControl: { id: 'ad.adControl', name: '广告控制栏' },
    adBar: { id: 'ad.adBar', name: '广告栏' },
    adBarTwo: { id: 'ad.adBarTwo', name: '广告栏2' },
    baiduAd: { id: 'ad.baiduAd', name: '百度广告' },
    googleAd: { id: 'ad.googleAd', name: '谷歌广告' },
    googleAdTwo: { id: 'ad.googleAdTwo', name: '谷歌广告2' },
    // 推广
    promotion: { id: 'ad.promotion', name: '推广' },
    goodsRecommendCard: { id: 'ad.goodsRecommendCard', name: '商品卡片' },
    goodsRecommendAd: { id: 'ad.goodsRecommendAd', name: '好物推荐' },
    reward: { id: 'ad.reward', name: '送礼物' },
  },
  ai: {
    aiEntry: { id: 'ai.aiEntry', name: 'AI 入口' },
    aiTab: { id: 'ai.aiTab', name: 'AI 分类' },
    aiAnswer: { id: 'ai.aiAnswer', name: 'AI 回答' },
    rightAsideAiAnswer: { id: 'ai.rightAsideAiAnswer', name: '右侧边栏-AI 回答' },
    resultAiAnswer: { id: 'ai.resultAiAnswer', name: '结果项-AI 回答' },
    aiAgent: { id: 'ai.aiAgent', name: '智能体回复' },
    aiCreate: { id: 'ai.aiCreate', name: 'AI 创作' },
    aiAbstract: { id: 'ai.aiAbstract', name: 'AI 摘要' },
    aiCode: { id: 'ai.aiCode', name: 'AI 写代码' },
    aiTool: { id: 'ai.aiTool', name: 'AI 工具' },
    aiAssistant: { id: 'ai.aiAssistant', name: 'AI 助手' },
    smartTool: { id: 'ai.smartTool', name: '智能工具' },
    smartToolTitle: { id: 'ai.smartToolTitle', name: '智能工具-标题' },
  },
  blog: {
    article: { id: 'blog.article', name: '文章' },
    authorInfo: { id: 'blog.authorInfo', name: '作者信息' },
    officialToc: { id: 'blog.officialToc', name: '官方目录' },
    officialTocTwo: { id: 'blog.officialTocTwo', name: '官方目录2' },
    officialTocThree: { id: 'blog.officialTocThree', name: '官方目录3' },
    customToc: { id: 'blog.customToc', name: '自定义目录' }, // 自定义
    customTocList: { id: 'blog.customTocList', name: '自定义目录列表' }, // 自定义
    relatedRecommend: { id: 'blog.relatedRecommend', name: '相关推荐' },
    recommendRead: { id: 'blog.recommendRead', name: '推荐阅读' },
    recommendColumn: { id: 'blog.recommendColumn', name: '推荐专栏' },
    categoryColumn: { id: 'blog.categoryColumn', name: '分类专栏' },
    recommendCommunity: { id: 'blog.recommendCommunity', name: '推荐社区' },
    articleActions: { id: 'blog.articleActions', name: '文章操作' },
    runnerBox: { id: 'blog.runnerBox', name: '运行盒子' },
    articleHr: { id: 'blog.articleHr', name: '文章分隔线' },
    articleComment: { id: 'blog.articleComment', name: '文章评论' },
    latestComment: { id: 'blog.latestComment', name: '最新评论' },
    articleEnd: { id: 'blog.articleEnd', name: '文章结尾' },
    articleTag: { id: 'blog.articleTag', name: '文章标签' },
    articleColumn: { id: 'blog.articleColumn', name: '文章专栏' },
    codeExperienceHint: { id: 'blog.codeExperienceHint', name: '代码体验提示' },
    hotArticle: { id: 'blog.hotArticle', name: '热门文章' },
    latestArticle: { id: 'blog.latestArticle', name: '最新文章' },
    articlePrevious: { id: 'blog.articlePrevious', name: '前后文章' },
    featuredCourse: { id: 'blog.featuredCourse', name: '精品课程' },
    recentArticles: { id: 'blog.recentArticles', name: '近期文章' },
    everyoneWatching: { id: 'blog.everyoneWatching', name: '大家在看' },
    applaudAuthor: { id: 'blog.applaudAuthor', name: '赞赏作者' },
    specialIncome: { id: 'blog.specialIncome', name: '专题收入' },
    extensionBox: { id: 'blog.extensionBox', name: '文章扩展盒子' },
    articleInfoCard: { id: 'blog.articleInfoCard', name: '文章信息卡片' },
  },
  search: {
    jumpSearch: { id: 'search.jumpSearch', name: '跳转搜索' },
    oftenSearch: { id: 'search.oftenSearch', name: '常用搜索' },
    hotSearch: { id: 'search.hotSearch', name: '热门搜索' },
    searchTab: { id: 'search.searchTab', name: '搜索分类' },
    unsupportedSearchTab: { id: 'search.unsupportedSearchTab', name: '搜索分类-未美化' },
    searchTag: { id: 'search.searchTag', name: '搜索标签' },
    searchTagFloat: { id: 'search.searchTagFloat', name: '搜索标签（浮动）' },
    searchCount: { id: 'search.searchCount', name: '搜索条数' },
    searchPagination: { id: 'search.searchPagination', name: '搜索分页' },
    searchInfo: { id: 'search.searchInfo', name: '搜索信息' },
    tipMessage: { id: 'search.tipMessage', name: '提示信息' },
    relatedSearches: { id: 'search.relatedSearches', name: '相关搜索' },
    everyoneSearching: { id: 'search.everyoneSearching', name: '大家在搜' },
    guessSearch: { id: 'search.guessSearch', name: '猜你想搜' },
    // 百度搜索
    video: { id: 'search.video', name: '视频' },
    encyclopedia: { id: 'search.encyclopedia', name: '百科' },
    shortVideo: { id: 'search.shortVideo', name: '短视频' },
    featuredNotes: { id: 'search.featuredNotes', name: '精选笔记' },
    developerSearch: { id: 'search.developerSearch', name: '开发者搜索' },
    huiLife: { id: 'search.huiLife', name: '惠生活' },
    softwarePark: { id: 'search.softwarePark', name: '软件园' },
    quickDownload: { id: 'search.quickDownload', name: '极速下载' },
    bingDictionary: { id: 'search.bingDictionary', name: '必应词典' },
    kingDictionary: { id: 'search.kingDictionary', name: '金山词霸' },
    baiduHotSearch: { id: 'search.baiduHotSearch', name: '百度热搜' },
    baiduWenku: { id: 'search.baiduWenku', name: '百度文库' },
    baiduTieBa: { id: 'search.baiduTieBa', name: '百度贴吧' },
    baiduChinese: { id: 'search.baiduChinese', name: '百度汉语' },
    baiduBaike: { id: 'search.baiduBaike', name: '百度百科' },
    baiduWeather: { id: 'search.baiduWeather', name: '百度天气' },
    baiduJiahao: { id: 'search.baiduJiahao', name: '百家号' },
    // 搜狗搜索
    souGouBaike: { id: 'search.souGouBaike', name: '搜狗百科' },
    souGouChinese: { id: 'search.souGouChinese', name: '搜狗汉语' },
  },
} as const // 定义为字面量类型
